from selenium.webdriver.common.by import By
from .base_page import BasePage



class LoginPage(BasePage):
    # 页面元素定位符
    input_username_locater = (By.XPATH,'//*[@id="loginForm_userPhone"]')
    input_password_locater = (By.XPATH,'//*[@id="loginForm_password"]')
    login_button_locater = (By.XPATH,'//*[@id="loginForm"]/div[4]/div/div/div/button')
    base_url = 'https://www.tk160.com/login'



    def enter_username(self, username):
        username_input = self.find_element(self.input_username_locater)
        username_input.send_keys(username)


    def enter_password(self, password):
        password_input = self.find_element(self.input_password_locater)
        password_input.send_keys(password)

    def click_login_button(self):
        self.click(self.login_button_locater)

